﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;
using BYRBBS.Model;

namespace BYRForum.Binding.SectionChoose
{
    public class BoardList
    {
        public BoardList()
        {
            this.Items = new ObservableCollection<BoardItem>();
        }
        public ObservableCollection<BoardItem> Items { get; private set; }

        public void LoadData(Board[] aList)
        {
            Items.Clear();
            for (int i = 0; i < aList.Length; i++)
            {
                this.Items.Add(new BoardItem()
                {
                    Name = aList[i].Name,
                    Description = aList[i].Description,
                    ByrClass = aList[i].ByrClass,
                    Section = aList[i].Section
                });
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
